﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace gc.utility.Exceptions
{
    /// <summary>
    /// 断言判断,不正确的时候抛出异常
    /// </summary>
    public static class Assert
    {
        public static void NotNull(object obj, string msg = "")
        {
            if (obj == null)
                throw new System.Exception(msg);
        }

        public static void NotNullOrWhiteSpace(string str, string msg = "")
        {
            if (string.IsNullOrWhiteSpace(str))
                throw new System.Exception(msg);
        }
    }

}
